TestListenerWrapper (Apache Ant API)

org.apache.tools.ant.taskdefs.optional.junit

## Class TestListenerWrapper

- java.lang.Object
- - org.apache.tools.ant.taskdefs.optional.junit.TestListenerWrapper

- All Implemented Interfaces:
    junit.framework.TestListener, IgnoredTestListener

      public class TestListenerWrapper
      extends java.lang.Object
      implements junit.framework.TestListener, IgnoredTestListener

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `TestListenerWrapper(junit.framework.TestListener listener)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addError(junit.framework.Test test, java.lang.Throwable throwable)`
    `void` | `addFailure(junit.framework.Test test, junit.framework.AssertionFailedError assertionFailedError)`
    `void` | `endTest(junit.framework.Test test)`
    `void` | `startTest(junit.framework.Test test)`
    `void` | `testAssumptionFailure(junit.framework.Test test, java.lang.Throwable throwable)` Receive a report that a test has failed an assumption.
    `void` | `testIgnored(junit.framework.Test test)` Reports when a test has been marked with the @Ignore annotation.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### TestListenerWrapper

          public TestListenerWrapper(junit.framework.TestListener listener)

  - ### Method Detail

    - #### addError

          public void addError(junit.framework.Test test,
                      java.lang.Throwable throwable)

      Specified by:
        `addError` in interface `junit.framework.TestListener`

    - #### addFailure

          public void addFailure(junit.framework.Test test,
                        junit.framework.AssertionFailedError assertionFailedError)

      Specified by:
        `addFailure` in interface `junit.framework.TestListener`

    - #### endTest

          public void endTest(junit.framework.Test test)

      Specified by:
        `endTest` in interface `junit.framework.TestListener`

    - #### startTest

          public void startTest(junit.framework.Test test)

      Specified by:
        `startTest` in interface `junit.framework.TestListener`

    - #### testIgnored

          public void testIgnored(junit.framework.Test test)

      Description copied from interface: `IgnoredTestListener`
      Reports when a test has been marked with the @Ignore annotation. The parameter should normally be typed to JUnit's `JUnit4TestCaseFacade` so implementing classes should be able to get the details of the ignore by casting the argument and retrieving the descriptor from the test.
      Specified by:
        `testIgnored` in interface `IgnoredTestListener`
      Parameters:
        `test` - the details of the test and failure that have triggered this report.

    - #### testAssumptionFailure

          public void testAssumptionFailure(junit.framework.Test test,
                                   java.lang.Throwable throwable)

      Description copied from interface: `IgnoredTestListener`
      Receive a report that a test has failed an assumption. Within JUnit4 this is normally treated as a test being skipped, although how any listener handles this is up to that specific listener.
      Note: Tests that throw assumption failures will still report the endTest method, which may differ from how the addError and addFailure methods work, it's up for any implementing classes to handle this.
      Specified by:
        `testAssumptionFailure` in interface `IgnoredTestListener`
      Parameters:
        `test` - the details of the test and failure that have triggered this report.
        `throwable` - the AssumptionViolatedException thrown from the current assumption failure.